package com.godyao.mall.core.model.goods;


import com.godyao.mall.core.model.AbstractAuditable;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * @author godyao
 * @date 2022/3/31
 */
@Entity
@Data
@Table(name = "t_goods")
public class Goods extends AbstractAuditable {

    @ApiModelProperty(value = "商品名称")
    @Column(name = "goods_name", length = 16)
    private String goodsName;

    @ApiModelProperty(value = "商品标题")
    @Column(name = "goods_title", length = 64)
    private String goodsTitle;

    @ApiModelProperty(value = "商品图片")
    @Column(name = "goods_img", length = 64)
    private String goodsImg;

    @Lob
    @ApiModelProperty(value = "商品明细")
    @Column(name = "goods_detail")
    private String goodsDetail;

    @ApiModelProperty(value = "商品价格")
    @Column(name = "goods_price", precision = 10, scale = 2)
    private BigDecimal goodsPrice;

    @ApiModelProperty(value = "商品库存")
    @Column(name = "goods_stock")
    private Integer goodsStock;
}
